package fei.zhou.lambdalearn.demo5;

import java.util.function.Function;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: Toshow
 * @date 2020/12/22 20:49
 * @Verson 1.0 -2020/12/22 20:49
 * @see
 */
public class Demo5 {
    
    public static void main(String[] args) {
        String s = "林青霞,30";
        
        convert(s,
                (String ss) -> {
            return s.split(",")[1];
        },
                (String ss) -> {
            return Integer.parseInt(ss);
        },
                (Integer i) -> {
            return i + 70;
        });
        
    }
    
    private static void convert(String s, Function<String, String> fun1, Function<String, Integer> fun2,
            Function<Integer, Integer> fun3) {
        int i = fun1.andThen(fun2).andThen(fun3).apply(s);
        System.out.println(i);
    }
}